# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=rrst
pkgver=1.0.1
pkgrel=1
pkgdesc='HTTP/2 Rapid Reset PoC tool written in Rust.'
arch=('x86_64' 'aarch64')
url='https://github.com/X-croot/rrst'
license=('MIT')
groups=('blackarch' 'blackarch-dos' 'blackarch-webapp')
depends=()
makedepends=('rustup')
source=("https://github.com/X-croot/rrst/archive/refs/tags/v$pkgver.tar.gz")
sha512sums=('7e573556f60a555ded53769cb2cbd30991336bf7ca0d1d8f9f3f6809ac5e138dea926863530b6bc3a0c2a248705d61fb1be4a7a683edc0605862154b067cf388')

build() {
  cd "$pkgname-$pkgver"

  if ! rustup show active-toolchain &>/dev/null; then
    rustup default stable
  fi

  cargo build --release
}

package() {
  cd "$pkgname-$pkgver"

  install -Dm 755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

